
<div ng-controller="PartStockDetailCtrl">
	
<div ng-include="'/templates/paramsSelect.html'"></div>
	<div class="page-heading">
		<ul class="breadcrumb">
			<li><a href="javascript:;">报表管理</a></li>
			<li><a href="javascript:;">配件报表</a></li>
			<li class="active" ng-hide="menuName">配件库存明细</li>
			<li class="active" ng-show="menuName" ng-bind="menuName"></li>
			<span style="margin-right:10px;"  class="btn btn-danger btn-xs pull-right btn-flag " ng-show="flag" ng-click="delFlag('/parts/partstockdetail/')"><i class="fa fa-times"></i> 删除 </span>
			<span style="margin-right:10px;"  class="btn btn-info btn-xs pull-right btn-flag " ng-click="addFlag('#/parts/partstockdetail/')"><i class="fa fa-star"></i> 收藏 </span>
		
		</ul>
	</div>
	<!-- 页面头部  end-->

	<!--页面内容显示区域-->
	<div class="wrapper">


		<div class="row">
			<div class="col-sm-12">
				<!--表格显示区域-->
				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						配件库存明细查询条件
						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起-->
							<button type="button" class="btn btn-success pull-left" ng-click="SearchData()" 
							style="margin-left: 5px;">
								<i class="fa fa-search"></i> 查询
							</button>
							<button type="button" class="btn btn-info  pull-left" ng-click="ExportData()" 
							style="margin-left: 5px;">
								<i class="fa fa-table"></i> 导出EXCEL
							</button> <a href="javascript:;" class="fa fa-chevron-up form_display"></a>

						</span>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal form_hide">
						<div class="row">
                        	 
                        	<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">事业部</label>
										<div class="col-lg-8 col-sm-7">
										<input type="text" id="group_name" ng-keyup="clearGroup()"  name="group_name"   class="form-control select_edit form_params" />
                                            <ul class="select_list">
                                                  <li ng-repeat="e in groups" ng-click='LoadBrands(e.group_name)' val_code="{{e.group_name}}" val_name="{{e.group_name}}">{{e.group_name}}</li>
                                            </ul>  
                                            </div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">店面品牌</label>
									<div class="col-lg-8 col-sm-7">
										<input type="text" id="entity_brand_name"  ng-keyup="clearGroupBrand()"  name="entity_brand_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in gBrands" ng-click='LoadEntitys(e)' val_code="{{e.brand_code}}" val_name="{{e.brand_name}}">{{e.brand_name}}</li>
                                            </ul> 
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label" for="inputEmail1">店面信息</label>
									<div class="col-lg-8 col-sm-7">
											<input type="text" id="entity_name" ng-keyup="clearGroupBrandEntity()"  name="entity_name" class="form-control select_edit form_params" value=""/>
                                            <ul class="select_list">
                                                  <li ng-repeat="e in entitys" ng-click='LoadEntityLevel(e)' val_code="{{e.entity_code}}" val_name="{{e.entity_name}}">{{e.entity_name}}({{e.entity_code}})</li>
                                            </ul>  
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">仓库</label>
									<div class="col-lg-8 col-sm-7">
										<select name="storage_code" class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in storage_list" value="{{b.storage_code}}">{{b.storage_name}}({{b.storage_name=='其他'?(b.storage_code | limitTo:30 )+'...' :b.storage_code}})</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件代码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="part_no" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">库龄范围</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range ">
											<input name="start_age" id="start_age" type="text" class="form-control form_params">
										</div>
									</div>
								</div>
							</div>
                            
                            <div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label text-center" for="inputEmail1">至</label>
									<div class="col-lg-8 col-sm-7">
										<div data-date-format="yyyy-mm-dd" data-date="2016-5-15" class="input-large custom-date-range">
											<input name="end_age" id="end_age" type="text" class="form-control form_params">
										</div>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">库位代码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="storage_position_code" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件名称</label>
									<div class="col-lg-8 col-sm-7">
										<input name="part_name" type="text" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">配件类别</label>
									<div class="col-lg-8 col-sm-7">
										<select name="part_group_code" class="form-control form_params">
											<option></option>
											<option  ng-repeat="b in part_type" value="{{b.status_desc}}">{{b.status_desc}}</option>
										</select>
										
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">九大类</label>
									<div class="col-lg-8 col-sm-7">
										<select name="part_main_type" class="form-control form_params">
											<option></option>
											<option ng-repeat="b in partmain_list" value="{{b.status_desc}}">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">拼音代码</label>
									<div class="col-lg-8 col-sm-7">
										<input name="spell_code" class="form-control form_params">
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">是否停用</label>
									<div class="col-lg-8 col-sm-7">
										<select name="part_status"  class="form-control form_params">
											<option></option>
											<option ng-repeat="b in part_status" value="{{b.status_code}}" ng-selected="b.status_code == '12781002'">{{b.status_desc}}</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">可用库存</label>
									<div class="col-lg-8 col-sm-7">
										<select name="enabled_storage"  class="form-control form_params">
											<option></option>
											<option value="0">=0</option>
											<option value="1">>0</option>
											<option value="3"><0</option>
											<option value="2">>=0</option>
											<option value="4"><=0</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3 ">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">排序</label>
									<div class="col-lg-8 col-sm-7">
										<select name="orderby"  class="form-control form_params">
											<option></option>
											<option value="0">按销售价排序</option>
											<option value="1">按含税成本单价排序</option>
										</select>
									</div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">二级类别</label>
									<div class="col-lg-8 col-sm-7">
                                            <select name="sub_group_name" class="form-control form_params" ng-model="subGroupName"  ng-change="loadThird(subGroupName)" >
												<option></option>
												<option   ng-repeat="b in sub_list" value="{{b.name}}" val_code="{{b.code}}">{{b.name}}</option>
										    </select>
                                    </div>
								</div>
							</div>
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">三级类别</label>
									<div class="col-lg-8 col-sm-7">
									       <select name="third_group_name" class="form-control form_params" ng-model="thirdGroupName" ng-change="loadFourth(thirdGroupName)" >
												<option></option>
												<option   ng-repeat="b in third_list_sel" value="{{b.name}}">{{b.name}}</option>
										    </select>
									</div>
								</div>
							</div>
							
							
							<div class="col-md-3">
								<div class="form-group">
									<label class="col-lg-4 col-sm-5 control-label"
										for="inputEmail1">四级类别</label>
									<div class="col-lg-8 col-sm-7">
										    <select name="fourth_group_name" class="form-control form_params" >
										 		<option></option>
												<option  ng-repeat="b in fourth_list_sel" value="{{b.name}}">{{b.name}}</option>
										    </select>
									</div>
								</div>
							</div>
							
							
						</div>
					</div>
				</section>

				<section class="panel">
					<!--区块头 显示表格名称和功能按钮-->
					<header class="panel-heading">
						配件库存明细报表
						<headshow></headshow>
						<div class="option_check_list" style="display: inline-block;"></div>

						<!--控制按钮-->
						<span class="tools pull-right"> <!--收起--> <a
							href="javascript:;" class="fa fa-chevron-down"></a>
						</span>
						<div class="pull-right"
							style="margin-right: 10px; margin-top: -6px; display: inline-block">
							<button type="button" class="btn btn-danger btn-sm " href="#paramsSelect"
								data-toggle="modal">
								<i class="fa fa-plus"></i> 在结果集中筛选
							</button>
							<button type="button" class="btn btn-success btn-sm"
								id="search_table" ng-click="SearchData();">
								<i class="fa fa-search"></i> 查询表格
							</button>
						</div>
					</header>
					<!--区块body 显示表格内容-->
					<div class="panel-body form-horizontal ">

						<div class="adv-table" style="overflow-x: scroll">
							<table id="partStockDetailTable"
								class="table table-striped  nowrap  dataTable no-footer table_store table-hover float_head"
								cellspacing="0" width="100%">
								<thead>
									<tr>
										<th ng-show="!cols.contains('index')" column="index">序号</th>
										<th ng-show="!cols.contains('entity_code')" column="entity_code">店面编号</th>
										<th ng-show="!cols.contains('entity_name')" column="entity_name">店面名称</th>
										<th ng-show="!cols.contains('entity_brand_name')" column="entity_brand_name">店面品牌</th>
										<th ng-show="!cols.contains('group_name')" column="group_name">事业部</th>
										<th ng-show="!cols.contains('storage_name')" column="storage_name">仓库</th>
										<th ng-show="!cols.contains('storage_position_code')" column="storage_position_code">库位代码</th>
										<th ng-show="!cols.contains('part_group_code')" column="part_group_code">配件类别</th>
										<th ng-show="!cols.contains('part_no')" column="part_no">配件代码</th>
										<th ng-show="!cols.contains('part_name')" column="part_name">配件名称</th>
										<th ng-show="!cols.contains('sub_group_name')" column="sub_group_name">二级类别</th>
										<th ng-show="!cols.contains('third_group_name')" column="third_group_name">三级类别</th>
										<th ng-show="!cols.contains('fourth_group_name')" column="fourth_group_name">四级类别</th>
										<th qtype='float' ng-show="!cols.contains('stock_quantity')" column="stock_quantity">库存数量</th>
										<th qtype='float' ng-show="!cols.contains('remain_quantity')" column="remain_quantity">可用库存</th>
										<th qtype='float' ng-show="!cols.contains('borrow_quantity')" column="borrow_quantity">借进数量</th>
										<th qtype='float' ng-show="!cols.contains('lend_quantity')" column="lend_quantity">借出数量</th>
										<th qtype='float' ng-show="!cols.contains('claim_price')" column="claim_price">索赔价</th>
										<th qtype='float' ng-show="!cols.contains('locked_quantity')" column="locked_quantity">预留数</th>
										<th qtype='float' ng-show="!cols.contains('sales_price')" column="sales_price">销售价</th>
										<th qtype='float' ng-show="!cols.contains('instruct_price')" column="instruct_price">建议销售价</th>
										<th qtype='float' ng-show="!cols.contains('insurance_price')" column="insurance_price">保险价</th>
										<th qtype='float' ng-show="!cols.contains('limit_price')" column="limit_price">销售限价</th>
										<th qtype='float' ng-show="!cols.contains('urgent_price')" column="urgent_price">急件价格</th>
										<th qtype='float' ng-show="!cols.contains('cost_price')" column="cost_price">成本单价</th>
										<th qtype='float' ng-show="!cols.contains('include_cost_price')" column="include_cost_price">含税成本单价</th>
										<th qtype='float' ng-show="!cols.contains('cost_amount')" column="cost_amount">成本金额</th>
										<th qtype='float' ng-show="!cols.contains('include_cost_amount')" column="include_cost_amount">含税成本金额</th>
										<th ng-show="!cols.contains('part_main_type')" column="part_main_type">九大类</th>
										<th ng-show="!cols.contains('unit_name')" column="unit_name">计量单位名称</th>
										<th ng-show="!cols.contains('producting_area')" column="producting_area">产地</th>
										<th qtype='float' ng-show="!cols.contains('max_stock')" column="max_stock">最大库存</th>
										<th qtype='float' ng-show="!cols.contains('min_stock')" column="min_stock">最小库存</th>
										<th qtype='float' ng-show="!cols.contains('min_package')" column="min_package">最小包装数</th>
										<th qtype='date' ng-show="!cols.contains('last_stock_in')" column="last_stock_in">最新入库日期</th>
										<th qtype='date' ng-show="!cols.contains('last_stock_out')" column="last_stock_out">最新出库日期</th>
										<th ng-show="!cols.contains('stock_date')" column="stock_date">库龄日</th>
										<th ng-show="!cols.contains('stock_day')" column="stock_day">库龄</th>
										<th qtype='date' ng-show="!cols.contains('create_date')" column="create_date">建档日期</th>
										<th qtype="bool" ng-show="!cols.contains('part_status')" column="part_status">是否停用</th>
										<th ng-show="!cols.contains('lead_time')" column="lead_time">订货周期</th>
										<th ng-show="!cols.contains('spell_code')" column="spell_code">拼音代码</th>
										<th ng-show="!cols.contains('option_no')" column="option_no">替代配件</th>
										<th ng-show="!cols.contains('remark')" column="remark">备注</th>
									</tr>
								</thead>
								<tbody>
									<tr ng-repeat="c in partStockDetailReports">
										<td ng-show="!cols.contains('index')" class="">{{$index + 1 }}</td>
										<td ng-show="!cols.contains('entity_code')" class="">{{c.entity_code}}</td>
										<td ng-show="!cols.contains('entity_name')" class="">{{c.entity_name}}</td>
										<td ng-show="!cols.contains('entity_brand_name')" class="">{{c.entity_brand_name}}</td>
										<td ng-show="!cols.contains('group_name')" class="">{{c.group_name}}</td>
										<td ng-show="!cols.contains('storage_name')" class="">{{c.storage_name}}</td>
										<td ng-show="!cols.contains('storage_position_code')" class="">{{c.storage_position_code}}</td>
										<td ng-show="!cols.contains('part_group_code')" class="">{{c.part_group_code}}</td>
										<td ng-show="!cols.contains('part_no')" class="">{{c.part_no}}</td>
										<td ng-show="!cols.contains('part_name')" class="">{{c.part_name}}</td>
										<td ng-show="!cols.contains('sub_group_name')" class="">{{c.sub_group_name}}</td>
										<td ng-show="!cols.contains('third_group_name')" class="">{{c.third_group_name}}</td>
										<td ng-show="!cols.contains('fourth_group_name')" class="">{{c.fourth_group_name}}</td>
										<td ng-show="!cols.contains('stock_quantity')" class="">{{c.stock_quantity | number:2}}</td>
										<td ng-show="!cols.contains('remain_quantity')" class="">{{c.remain_quantity | number:2}}</td>
										<td ng-show="!cols.contains('borrow_quantity')" class="">{{c.borrow_quantity | number:2}}</td>
										<td ng-show="!cols.contains('lend_quantity')" class="">{{c.lend_quantity | number:2}}</td>
										<td ng-show="!cols.contains('claim_price')" class="">{{c.claim_price | number:2}}</td>
										<td ng-show="!cols.contains('locked_quantity')" class="">{{c.locked_quantity | number:2}}</td>
										<td ng-show="!cols.contains('sales_price')" class="">{{c.sales_price | number:2}}</td>
										<td ng-show="!cols.contains('instruct_price')" class="">{{c.instruct_price | number:2}}</td>
										<td ng-show="!cols.contains('insurance_price')" class="">{{c.insurance_price | number:2}}</td>
										<td ng-show="!cols.contains('limit_price')" class="">{{c.limit_price | number:2}}</td>
										<td ng-show="!cols.contains('urgent_price')" class="">{{c.urgent_price | number:2}}</td>
										<td ng-show="!cols.contains('cost_price')" class="">{{c.cost_price | number:4}}</td>
										<td ng-show="!cols.contains('include_cost_price')" class="">{{c.include_cost_price | number:2}}</td>
										<td ng-show="!cols.contains('cost_amount')" class="">{{c.cost_amount | number:2}}</td>
										<td ng-show="!cols.contains('include_cost_amount')" class="">{{c.include_cost_amount | number:2}}</td>
										<td ng-show="!cols.contains('part_main_type')" class="">{{c.part_main_type}}</td>
										<td ng-show="!cols.contains('unit_name')" class="">{{c.unit_name}}</td>
										<td ng-show="!cols.contains('producting_area')" class="">{{c.producting_area}}</td>
										<td ng-show="!cols.contains('max_stock')" class="">{{c.max_stock | number:2}}</td>
										<td ng-show="!cols.contains('min_stock')" class="">{{c.min_stock | number:2}}</td>
										<td ng-show="!cols.contains('min_package')" class="">{{c.min_package | number:2}}</td>
										<td ng-show="!cols.contains('last_stock_in')" class="">{{c.last_stock_in | date:'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('last_stock_out')" class="">{{c.last_stock_out | date:'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('stock_date')" class="">{{c.stock_date | date:'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('stock_day')" class="">{{c.stock_day}}</td>
										<td ng-show="!cols.contains('create_date')" class="">{{c.create_date | date:'yyyy-MM-dd'}}</td>
										<td ng-show="!cols.contains('part_status')" class="">{{c.part_status == null?"":(c.part_status=='12781001'?'是':'否')}}</td>
										<td ng-show="!cols.contains('lead_time')" class="">{{c.lead_time}}</td>
										<td ng-show="!cols.contains('spell_code')" class="">{{c.spell_code}}</td>
										<td ng-show="!cols.contains('option_no')" class="">{{c.option_no}}</td>
										<td ng-show="!cols.contains('remark')" class="">{{c.remark}}</td>
									</tr>

									<tr class="tbody_last_tr" ng-show="pagination.totalItems > 0">
										<td ng-show="!cols.contains('index')" class=""></td>
										<td ng-show="!cols.contains('entity_code')" class=""></td>
										<td ng-show="!cols.contains('entity_name')" class=""></td>
										<td ng-show="!cols.contains('entity_brand_name')" class=""></td>
										<td ng-show="!cols.contains('group_name')" class=""></td>
										<td ng-show="!cols.contains('storage_name')" class=""></td>
										<td ng-show="!cols.contains('storage_position_code')" class=""></td>
										<td ng-show="!cols.contains('part_group_code')" class=""></td>
										<td ng-show="!cols.contains('part_no')" class=""></td>
										<td ng-show="!cols.contains('part_name')" class=""></td>
										<td ng-show="!cols.contains('sub_group_name')" class=""></td>
										<td ng-show="!cols.contains('third_group_name')" class=""></td>
										<td ng-show="!cols.contains('fourth_group_name')" class=""></td>
										<td ng-show="!cols.contains('stock_quantity')" class="">{{partStockDetailReportsSum.sum_stock_quantity.value | number:2}}</td>
										<td ng-show="!cols.contains('remain_quantity')" class="">{{partStockDetailReportsSum.sum_remain_quantity.value | number:2}}</td>
										<td ng-show="!cols.contains('borrow_quantity')" class="">{{partStockDetailReportsSum.sum_borrow_quantity.value | number:2}}</td>
										<td ng-show="!cols.contains('lend_quantity')" class="">{{partStockDetailReportsSum.sum_lend_quantity.value | number:2}}</td>
										<td ng-show="!cols.contains('claim_price')" class=""></td>
										<td ng-show="!cols.contains('locked_quantity')" class=""></td>
										<td ng-show="!cols.contains('sales_price')" class=""></td>
										<td ng-show="!cols.contains('instruct_price')" class=""></td>
										<td ng-show="!cols.contains('insurance_price')" class=""></td>
										<td ng-show="!cols.contains('limit_price')" class=""></td>
										<td ng-show="!cols.contains('urgent_price')" class=""></td>
										<td ng-show="!cols.contains('cost_price')" class=""></td>
										<td ng-show="!cols.contains('include_cost_price')" class=""></td>
										<td ng-show="!cols.contains('cost_amount')" class="">{{partStockDetailReportsSum.sum_cost_amount.value | number:2}}</td>
										<td ng-show="!cols.contains('include_cost_amount')" class="">{{((partStockDetailReportsSum.sum_cost_amount.value*0.16)+partStockDetailReportsSum.sum_cost_amount.value) | number:2}}</td>
										<td ng-show="!cols.contains('part_main_type')" class=""></td>
										<td ng-show="!cols.contains('unit_name')" class=""></td>
										<td ng-show="!cols.contains('producting_area')" class=""></td>
										<td ng-show="!cols.contains('max_stock')" class=""></td>
										<td ng-show="!cols.contains('min_stock')" class=""></td>
										<td ng-show="!cols.contains('min_package')" class=""></td>
										<td ng-show="!cols.contains('last_stock_in')" class=""></td>
										<td ng-show="!cols.contains('last_stock_out')" class=""></td>
										<td ng-show="!cols.contains('stock_date')" class=""></td>
										<td ng-show="!cols.contains('stock_day')" class=""></td>
										<td ng-show="!cols.contains('create_date')" class=""></td>
										<td ng-show="!cols.contains('part_status')" class=""></td>
										<td ng-show="!cols.contains('lead_time')" class=""></td>
										<td ng-show="!cols.contains('spell_code')" class=""></td>
										<td ng-show="!cols.contains('option_no')" class=""></td>
										<td ng-show="!cols.contains('remark')" class=""></td>
									</tr>
								</tbody>
							</table>
							<div class="no-items" ng-show="pagination.totalItems <= 0">暂无数据</div>
						</div>
						<tm-pagination conf="pagination"></tm-pagination>
					</div>
				</section>
				<!--表格显示区域-->

			</div>
		</div>
	</div>
</div>

<form id="export_form" action="partStockDetail/export"  method="post">
	<input type="hidden" name="keys" id="keys" />
	<input type="hidden" name="names" id="names" /> 
	<input type="hidden" name="params" id="params" />
	<input type="hidden" name="search_opt" id="search_opt" /> 
	<input type="hidden" name="file_name" id="file_name" value="配件库存明细"/>
</form>



